package com.net;

public class SecondLargestNo {

	public static void main(String[] args)
	{
		int secondLargest = Integer.MIN_VALUE;
		int largest = Integer.MIN_VALUE;
		
		int[] arr = {2,4,6,13,16,15};
		
		for(int i =0;i<arr.length;i++)
		{
			if(largest<arr[i])
			{
				
				secondLargest = largest;
				largest = arr[i];
			}
			if(secondLargest<arr[i] && largest != arr[i])
			{
				secondLargest = arr[i];
			}
		}
		
		System.out.println(secondLargest);

	}

}
